Ext.namespace("MyPlan.Main");

MyPlan.Main.tabIndex = {
	"planing" : 0,
	"toaudit": 1,
	"execute" : 2,
	"closed" : 3
};
MyPlan.Main.tabs = [];

MyPlan.initUI = function() {
	var opentab = Utils.getParameter('opentab');
	if (!opentab) opentab = "planing";
	
	// init tabs
	MyPlan.Main.tabs.push(new MyPlan.Planing());
	MyPlan.Main.tabs.push(new MyPlan.ToAudit());
	MyPlan.Main.tabs.push(new MyPlan.Execute());
	MyPlan.Main.tabs.push(new MyPlan.Closed());
	
	MyPlan.instance = new Ext.TabPanel({
		region: 'center',
		activeTab: MyPlan.Main.tabIndex[opentab],
		items: MyPlan.Main.tabs
	});
	
	var mainview = new Ext.Viewport({
        layout:'border',
        items:[MyPlan.instance]
    });
};

Ext.onReady(function(){
	Ext.QuickTips.init();
    Ext.BLANK_IMAGE_URL = '../resources/images/default/s.gif';
	MyPlan.initUI();
});